/**********************************************************************
 *
 * $RCSfile: MemoryEventChannel.java,v $  $Revision: 1.1 $  $Date: 2009/08/09 08:00:56 $
 *
 * $Log: MemoryEventChannel.java,v $
 * Revision 1.1  2009/08/09 08:00:56  @author simplefan
 * *** empty log message ***
 *
 *
 *
 *********************************************************************/
/*
 * Copyright 2008 gxlu, Inc. All rights reserved.
 * File name : MemoryEventChannel.java
 * Created on : Jul 30, 2009 1:50:57 AM
 * Creator : lethe
 */
package com.simplefan.meta.eda;

import java.util.List;

/**
 * <pre>
 * Description : TODO
 * @author simplefan
 * </pre>
 */
public class MemoryEventChannel extends AbstractEventChannel {

  public void publish(Event event) {
    List<EventListener> objectList = getListener(event.getEventType());
    if(objectList != null && objectList.size() > 0) {
      for(int i = 0; i < objectList.size(); i++) {
        EventListener listener = objectList.get(i);
        publish(event, listener);
      }
    }
  }

  private void publish(Event event, EventListener listener) {
    listener.onEvent(event);
  }

}
